package com.yuwei.home.adapter

import android.annotation.SuppressLint
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.yuwei.home.R
import com.yuwei.common.entity.SimpleVideoEntityItem
import com.yuwei.image.glide.GlideImageLoader
import java.util.*

class SimpleVideoAdapter: BaseQuickAdapter<SimpleVideoEntityItem, BaseViewHolder>(
    R.layout.item_simple_video
) {
    @SuppressLint("SimpleDateFormat")
    override fun convert(holder: BaseViewHolder, item: SimpleVideoEntityItem) {
        val image = holder.getView<ImageView>(R.id.simple_video_image)
        GlideImageLoader.loadImage(image.context,image,item.videomainimag)
        holder.setText(R.id.simple_video_desc,item.description)
        val icon = holder.getView<ImageView>(R.id.simple_video_icon)
        GlideImageLoader.loadCircleImage(icon.context,icon,item.avatar_url)
        holder.setText(R.id.simple_video_author_name,item.name)
    }
}